package com.our123.cms.dao.assist.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.our123.cms.dao.assist.CmsCommentReplyDao;
import com.our123.cms.entity.assist.CmsCommentReply;
import com.our123.common.hibernate3.Finder;
import com.our123.common.hibernate3.HibernateBaseDao;

@Repository
public class CmsCommentReplyDaoImpl extends HibernateBaseDao<CmsCommentReply, Integer> implements CmsCommentReplyDao {
	@Override
	protected Class<CmsCommentReply> getEntityClass() {
		return CmsCommentReply.class;
	}

	@SuppressWarnings("unchecked")
	public List<CmsCommentReply> getList(int commentId) {
		Finder f = Finder.create("select bean from CmsCommentReply as bean where bean.comment.id=:commentId order by bean.id desc");
		f.setParam("commentId", commentId);
		return find(f);
	}

	public CmsCommentReply save(CmsCommentReply reply) {
		getSession().save(reply);
		return reply;
	}
}
